cmd=${words[1]}
- local commands=$(cargo --list | tail -n +2)
local vcs='git hg none'
local opt_help='-h --help'
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "${opt___nocmd}" -- "$cur" ) )
else
- COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "$__cargo_commands" -- "$cur" ) )
fi
elif [[ $cword -ge 2 ]]; then
case "${prev}" in
COMPREPLY=( $( compgen -W "$(_get_examples)" -- "$cur" ) )
;;
help)
- COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "$__cargo_commands" -- "$cur" ) )
;;
*)
local opt_var=opt__${cmd//-/_}
} &&
complete -F _cargo cargo
+__cargo_commands=$(cargo --list | tail -n +2)
+
_locate_manifest(){
local manifest=`cargo locate-project 2>/dev/null`
# regexp-replace manifest '\{"root":"|"\}' ''